Release 10.1A: OpenEdge Development:
Java Open Clients


Providing meta data for INPUT TABLE-HANDLE parameters

For TABLE parameters, the proxy calls the next() and getObject() methods to get the data that needs to be passed to the AppServer methods. For a TABLE-HANDLE parameter, the proxy must first call the getMetaData() method to determine the format of the data.

There are several alternatives for how getMetaData() can supply the appropriate ResultSetMetaData object:

ProResultSetMetaDataImpl class

If the meta data for the input ResultSet must be supplied by code implemented in the client application, the getMetaData() method must be implemented to return an instance of ResultSetMetaData. The recommended way to do this is to use the com.progress.open4gl.ProResultSetMetaDataImpl class provided in the Open Client Toolkit. This is an implementation of the ProResultSetMetaData interface, the same interface that is used by the client when getting output data.

The only two methods of ProResultSetMetaDataImpl the application must call are the constructor and the SetFieldMetaData() method, as follows:

Syntax
ProResultSetMetaDataImpl(int numFields) 

Syntax
SetFieldMetaData(int fieldNumber, String Name, int extent, int type) 

The SetFieldMetaData() method requires the following:

To pass a self-implemented ResultSet for a TABLE–HANDLE parameter, the application must:

  1. Create a new class that extends com.progress.open4gl.InputResultSet, to provide access to the data to be passed to the server. This object’s implementation includes code for next() and getObject() (as for a static temp-table) and for getMetaData(), which should return the com.progress.open4gl.ProResultSetMetaDataImpl instance when called.
  2. Create an instance of the class you created in Step 1.
  3. Create an instance of com.progress.open4gl.ProResultSetMetaDataImpl.
  4. Call ProResultSetMetaDataImpl.setFieldMetaData() for each field of the table.
  5. Make the ProResultSetMetaDataImpl instance available to the InputResultSet object. You can do this in any way you like, for example, by adding a setMetaData() method to your InputResultSet implementation.
  6. Make the proxy method call passing the com.progress.open4gl.InputResultSet instance as the parameter.
  7. Note: Step 3 and Step 4 can be implemented in getMetaData() which eliminates the need for Step 5.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095